4. processing and sorting machine generic device integration 4
因此,在上一个视频中,我们将破坏转换为通用设备方法,我们将继续讨论电梯站,对于欧盟,我们将始终与电梯设备交互,而不是像以前那样使用所有传感器和执行器。我们以前做过。
So in the last video, we converted the devastation to the generic device approach and we will move on to the elevator station and for the EU, we will always interact with the elevator device instead of using all the sensors and actuators in the same way that we did before.
首先,和以前一样,当我们以与其他站相同的方式启动机器时,我们需要做的是这里。
So first of all, as before, are we need to do is here when we start the machine in the same way that we did for the other station.
因此,我们需要启用我们正在使用的通用设备功能块。
So we need to enable the generic device function block that we are using.
因此,这里我们将拥有应该是已启用的通用设备的电梯设备。
So here we will have the elevator device that should be the enabled generic device.
输入应该通过,然后我们将移动到 10。
Input should be come through and then we will move to 10.
好吧,抱歉,但这是不正确的,因为我们不能这样做,我们需要等待杠杆移开,因为如果电梯处于中间位置,它将根据什么开始向上或向下移动我们命令它。
Well, sorry, but this is not correct, because we cannot do this, we will need to wait for the lever to be out of the way because if the elevator is in a middle position, it will start moving up or down according to what we command it with.
所以我们不能在这里启用它,因为我们需要确保杠杆不碍事,为了做到这一点,我们将不再查看传感器。
So we cannot enable it right here because we need to make sure that the levers out of the way and in order to do so, we will no longer look at the sensor.
我们将查看杠杆设备,该设备的状态应等于禁用。
We will look at the lever device that the device is state that should be equal to disabled.
如果这等于禁用,那么我们可以启用电梯的通用设备,并且我们能够执行所有的移动,因此我们将得到状态 20,在状态 20 中我们需要将电梯向下移动到底部传感器。
If this is equal to disabled, then we can enable the general device for the elevator and we are able to carry out all of our movements, so we will get the state 20 in which we need to move the elevator down to the bottom sensor.
为了做到这一点,我们将不再使用这些执行器的传感器。
And in order to do so, we no longer we will no longer use of the sensors of these actuators.
这里简单写一下,电梯设备、设备公司应该是平等的。
And here we will write it simply that elevator device, the device company should be equal.
力和升降机将开始向下移动,直到到达传感器并停止。
The force and the elevator will start moving down until it reaches the sensor on which it will stop.
所以我们不再看传感器,而是看状态。
So we will no longer look at the sensor, but we will look at the state.
所以电梯设备,该设备状态应该等于禁用。
So elevator device, that device state should be equal to disabled.
然后这里我们就不再看这两个不再将向下和向上执行器设置为强制,因为设备在达到禁用状态时会自动处理。
And then here we will no longer look at the and this two will no longer set the down and up actuator to force because the device will automatically handle it when it reaches the disabled state.
这适用于双驱动、双反馈,呃,没有双反馈装置。
This goes for a double actuation, double feedback, uh, no double feedback device.
正如您所看到的,我们管理电梯的方式与我们管理电梯的方式相同。
So as you can see, we are managing the elevator in the same way that we are doing it.
呃,让我们看看活塞。
Uh, let's see the piston.
它实际上是相同的。
It is actually identical.
它是通用的。
It is generic.
它适用于任何设备。
It works with any device.
而且,呃,这,呃,非常简单。
And, uh, it is, uh, quite simple.
大多数情况下,如果我们对机器的架构进行修改,那么改变它就会很容易。
And mostly if we will do modifications to the architecture of the machine, it will be very easy to change it.
因此,我们将在这里等待产品并等待杠杆离开。
So here we will wait for product and for the lever to be left.
因此,这种情况下的这些条件可以保留,因为这些是机器传感器,实际上不仅仅与设备相关。
So these conditions in this condition can stay because those are machine sensors that are not actually only related to device.
这里我们将不再看传感器的水平,而是看,呃,杠杆装置,那个装置应该等于力,这意味着禁用,这意味着杠杆在左边。
And here we will no longer look at the level of sensor, but we will look at the, uh, lever device, that device that should be equal to force, which means to disable the which means that the lever is on the left.
如果左边的杠杆我们这里有产品,而培训站上没有产品,我们应该能够向上移动。
If the levers on the left we have a product here and there is no product on the training station, we should be able to move up.
好的,我们到达了状态 40,需要移动电梯。
OK, so we reached the state 40 where we need to move the elevator.
这样我们实际上就可以启用电梯设备,这样我们就可以复制它,然后将其直接粘贴到副命令中,并在状态结束时检查是否已启用,然后移至状态 50。
Up so we can actually carry out an enabling of the elevator device so we can copy this and let's paste this over here simply right through to the vice command and check for enabled at the end of the state and then move to state 50.
好的,所以我们可以删除此代码,然后当我们处于状态 50 时,我们将等待,以便电梯上不再有产品可以向下移动。
OK, so we can delete this code and then when we are in state 50, we will wait in order to no longer have a product on the elevator to move down to.
国家,呃。
State, uh.
状态 20,实际上,我相信这是之前的一个错误,我们需要回到状态 10,因为与之前一样,我们需要确保肝脏不受影响。
State 20, actually, I believe this was a mistake earlier on, we need to move back to state 10 because in the same way as before, we need to be sure to have the liver out of the way.
为了安全移动,好吧,这太好了。
In order to safely move, OK, this is great.
我们将继续讨论需要更改紧急情况的紧急情况,很抱歉,不是紧急情况,而是按下紧急按钮时我们需要执行的操作。
We will move on onto the emergency condition that needs to change the emergency condition is there so sorry, not the emergency condition, but what we need to do on the emergency button is pressed.
我们需要禁用电梯设备。
We will need to disable the elevator device.
因此,电梯设备启用的通用设备应设置为等于力。
So elevator device enabled generic device should be set equal to force.
这样电梯无论在哪里都会停下来,我们会回到零状态。
And this way the elevator will stop no matter where it is, and we'll get back to state zero instead.
当我们按下停止按钮时,我们需要等待电梯上行或下行。
When we are pressing the stop button, we will need to wait for the elevator to either be up or down.
这意味着我们将关注国家。
And this means that we will look at the state.
所以电梯的电梯设备,那个设备状态应该等于任何一个票据或者说它应该相等。
So the elevator elevator device, that device state should be equal to any bill or it should be equal.
我不设备状态应该等于禁用。
I not device state should be equal to disabled.
然后我们将不再需要这些线路,因为设备将管理它,我们将需要返回到零。
Then we will no longer need these lines because the device will manage that and we will need to go back to zero.
好的,这很好。
OK, this is good.
哦哦,我想我们已经成功管理这里的一切了,这样我们就可以上网测试我们编写的这三个站是否正常运行了。
Uh oh, I guess we managed to manage everything here so we can go online and test for now the normal functioning of these three stations that we wrote.
那么让我们开始看看它们是否按预期工作。
So let's start and let's see if they work as intended.
来看看水平吧
Let's see the level.
好的。
OK.
似乎有效。
Seems to work.
在水涨落之前效果很好,然后堤坝应该移回那里。
Quite well as it worked before the water goes up and it gets down, then the levees should move back there.
按紧急情况。
Press emergency.
在这里,这种情况发生了。
Here, this happens.
这就是我们需要发生的事情。
That was what we needed to happen.
一旦我们拿到产品,让我们看看电梯的紧急情况。
Let's see the emergency for the elevator once we get a product there.
一旦电梯向上移动。
Once the elevator is moving up.
伙计,我想它会按预期工作。
Man, I guess it will work as intended.
好的,太好了,让我们重新开始并尝试保持一下。
OK, that's great, let's start again and try some hold.
我会把握现在。
I will hold the now.
雷莱斯。
Reles.
我现在就坚持下去。
I will hold now.
真的是。
Really is.
我现在就坚持下去。
I will hold now.
还有雷莱斯。
And Reles.
现在坚持一下。
Hold on now.
12岁。
12 years old.
雷莱斯。
Reles.
好的。
OK.
呃,我猜。
Uh, I guess.
有些东西被卡住了,我们可以。
Something got stuck and we can.
其实看看。
Actually see.
呃,Willerton,让我们看看主程序中我可能做错了什么。
Uh, Willerton, let us see maybe something in the main program that I did the wrong way.
我们处于州 500。
We are in a state 500.
和。
And.
有些东西似乎不起作用。
Something seems to not work.
这里正确。
Correctly here.
因为。
Because.
我们不具备所有这些条件,但它没有前进,所以主程序中似乎有一个错误。
We do not have all these conditions, but it is not moving forward, so there seemed to be a mistake in the main program.
我错过的是这里的这五行,因为当我们处于状态零时,我们需要删除所有机器、所有站的所有输入时的整个状态。
What I missed it is this five lines here, because we need to remove the whole state when the all the input to all the machines, to all the stations when we are in state zero.
所以这五行应该添加在这里。
So this five lines should be added here.
我会等你这么做,我会的。
I'll wait for you to do that and I will.
我们现在无法测试停止条件、停止功能,因为我们需要所有站点并行工作,因为我们有一个控制一切的主要政策。
We cannot test right now the stopping of the conditions, the estopinal functions, because we need all the stations to work in parallel, because we have a main policy controlling everything.
因此,当我们使用通用设备编写了所有车站代码后,我们将测试车站和所有,呃,功能。
So we will test the stop and all the, uh, features when we have written all the stations code with the generic devices.
这就是本视频的内容,我们将继续进行钻孔和工作台。
And so this is it for this video, we will move on to the drilling and the table station.